# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=plantri
pkgver=5.3
pkgrel=2
pkgdesc='A program for generation of certain types of planar graph'
arch=(loong64 x86_64)
url='https://cs.anu.edu.au/~bdm/plantri/'
license=(custom)
depends=(glibc)
source=(https://cs.anu.edu.au/~bdm/plantri/plantri${pkgver/./}.tar.gz LICENSE)
sha256sums=('423e2c439f05f68a822e8626875b564213b9510f6cd0d8ac043d1ec893e452f6'
            '83a2186806f5f535ebc2ba0381830bc1528f38c8484bf9d7c1977011c25a424a')

prepare() {
  sed -e '/CFLAGS=/d' -e '/LDFLAGS=/d' -i plantri${pkgver/./}/makefile
}

build() {
  cd plantri${pkgver/./}
  make
}

package() {
  cd plantri${pkgver/./}

  mkdir -p "$pkgdir"/usr/bin
  cp plantri fullgen "$pkgdir"/usr/bin/

  mkdir -p "$pkgdir"/usr/share/licenses/$pkgname
  cp "$srcdir"/LICENSE "$pkgdir"/usr/share/licenses/$pkgname
}
